// token存本地
export const setTokenStorage = (token) => {
    localStorage.setItem('token', JSON.stringify(token))
}

// 本地读取token
export const getTokenStorage = () => {
    const empty = ''
    const token = localStorage.getItem('token')
    return token ? JSON.parse(token) : empty
}

// 本地删除token
export const delTokenStorage = () => {
    localStorage.removeItem('token')
}

// 用户信息存本地
export const setUserInfoStorage = (obj) => {
    localStorage.setItem('userInfo', JSON.stringify(obj))
}

// 本地读取用户信息
export const getUserInfoStorage = () => {
    const empty = ''
    const userInfo = localStorage.getItem('userInfo')
    return userInfo ? JSON.parse(userInfo) : empty
}

// 本地删除用户信息
export const delUserInfoStorage = () => {
    localStorage.removeItem('userInfo')
}